<?php


abstract class BaseRingtoneOrigin extends BaseObject  implements Persistent {


	
	protected static $peer;


	
	protected $id;


	
	protected $name;


	
	protected $user_id;


	
	protected $song_id;


	
	protected $beat_id = 0;


	
	protected $song_name;


	
	protected $file_path;


	
	protected $clip_id;


	
	protected $file_path_wav;


	
	protected $spectrum_path;


	
	protected $spectrum_width;


	
	protected $category_id;


	
	protected $artist1_id;


	
	protected $artist1_name;


	
	protected $artist2_id;


	
	protected $artist2_name;


	
	protected $artist3_id;


	
	protected $artist3_name;


	
	protected $composer_id;


	
	protected $composer_name;


	
	protected $album_id;


	
	protected $album_name;


	
	protected $track_no;


	
	protected $genre;


	
	protected $lyrics;


	
	protected $bitrate;


	
	protected $duration;


	
	protected $created_datetime;


	
	protected $remark;


	
	protected $checknum;


	
	protected $convert_song_id;


	
	protected $origin_status = 0;


	
	protected $is_upload = 0;

	
	protected $alreadyInSave = false;

	
	protected $alreadyInValidation = false;

	
	public function getId()
	{

		return $this->id;
	}

	
	public function getName()
	{

		return $this->name;
	}

	
	public function getUserId()
	{

		return $this->user_id;
	}

	
	public function getSongId()
	{

		return $this->song_id;
	}

	
	public function getBeatId()
	{

		return $this->beat_id;
	}

	
	public function getSongName()
	{

		return $this->song_name;
	}

	
	public function getFilePath()
	{

		return $this->file_path;
	}

	
	public function getClipId()
	{

		return $this->clip_id;
	}

	
	public function getFilePathWav()
	{

		return $this->file_path_wav;
	}

	
	public function getSpectrumPath()
	{

		return $this->spectrum_path;
	}

	
	public function getSpectrumWidth()
	{

		return $this->spectrum_width;
	}

	
	public function getCategoryId()
	{

		return $this->category_id;
	}

	
	public function getArtist1Id()
	{

		return $this->artist1_id;
	}

	
	public function getArtist1Name()
	{

		return $this->artist1_name;
	}

	
	public function getArtist2Id()
	{

		return $this->artist2_id;
	}

	
	public function getArtist2Name()
	{

		return $this->artist2_name;
	}

	
	public function getArtist3Id()
	{

		return $this->artist3_id;
	}

	
	public function getArtist3Name()
	{

		return $this->artist3_name;
	}

	
	public function getComposerId()
	{

		return $this->composer_id;
	}

	
	public function getComposerName()
	{

		return $this->composer_name;
	}

	
	public function getAlbumId()
	{

		return $this->album_id;
	}

	
	public function getAlbumName()
	{

		return $this->album_name;
	}

	
	public function getTrackNo()
	{

		return $this->track_no;
	}

	
	public function getGenre()
	{

		return $this->genre;
	}

	
	public function getLyrics()
	{

		return $this->lyrics;
	}

	
	public function getBitrate()
	{

		return $this->bitrate;
	}

	
	public function getDuration()
	{

		return $this->duration;
	}

	
	public function getCreatedDatetime($format = 'Y-m-d H:i:s')
	{

		if ($this->created_datetime === null || $this->created_datetime === '') {
			return null;
		} elseif (!is_int($this->created_datetime)) {
						$ts = strtotime($this->created_datetime);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [created_datetime] as date/time value: " . var_export($this->created_datetime, true));
			}
		} else {
			$ts = $this->created_datetime;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getRemark()
	{

		return $this->remark;
	}

	
	public function getChecknum()
	{

		return $this->checknum;
	}

	
	public function getConvertSongId()
	{

		return $this->convert_song_id;
	}

	
	public function getOriginStatus()
	{

		return $this->origin_status;
	}

	
	public function getIsUpload()
	{

		return $this->is_upload;
	}

	
	public function setId($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->id !== $v) {
			$this->id = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::ID;
		}

	} 
	
	public function setName($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->name !== $v) {
			$this->name = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::NAME;
		}

	} 
	
	public function setUserId($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->user_id !== $v) {
			$this->user_id = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::USER_ID;
		}

	} 
	
	public function setSongId($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->song_id !== $v) {
			$this->song_id = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::SONG_ID;
		}

	} 
	
	public function setBeatId($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->beat_id !== $v || $v === 0) {
			$this->beat_id = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::BEAT_ID;
		}

	} 
	
	public function setSongName($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->song_name !== $v) {
			$this->song_name = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::SONG_NAME;
		}

	} 
	
	public function setFilePath($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->file_path !== $v) {
			$this->file_path = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::FILE_PATH;
		}

	} 
	
	public function setClipId($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->clip_id !== $v) {
			$this->clip_id = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::CLIP_ID;
		}

	} 
	
	public function setFilePathWav($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->file_path_wav !== $v) {
			$this->file_path_wav = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::FILE_PATH_WAV;
		}

	} 
	
	public function setSpectrumPath($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->spectrum_path !== $v) {
			$this->spectrum_path = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::SPECTRUM_PATH;
		}

	} 
	
	public function setSpectrumWidth($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->spectrum_width !== $v) {
			$this->spectrum_width = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::SPECTRUM_WIDTH;
		}

	} 
	
	public function setCategoryId($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->category_id !== $v) {
			$this->category_id = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::CATEGORY_ID;
		}

	} 
	
	public function setArtist1Id($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->artist1_id !== $v) {
			$this->artist1_id = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::ARTIST1_ID;
		}

	} 
	
	public function setArtist1Name($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->artist1_name !== $v) {
			$this->artist1_name = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::ARTIST1_NAME;
		}

	} 
	
	public function setArtist2Id($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->artist2_id !== $v) {
			$this->artist2_id = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::ARTIST2_ID;
		}

	} 
	
	public function setArtist2Name($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->artist2_name !== $v) {
			$this->artist2_name = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::ARTIST2_NAME;
		}

	} 
	
	public function setArtist3Id($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->artist3_id !== $v) {
			$this->artist3_id = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::ARTIST3_ID;
		}

	} 
	
	public function setArtist3Name($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->artist3_name !== $v) {
			$this->artist3_name = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::ARTIST3_NAME;
		}

	} 
	
	public function setComposerId($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->composer_id !== $v) {
			$this->composer_id = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::COMPOSER_ID;
		}

	} 
	
	public function setComposerName($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->composer_name !== $v) {
			$this->composer_name = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::COMPOSER_NAME;
		}

	} 
	
	public function setAlbumId($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->album_id !== $v) {
			$this->album_id = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::ALBUM_ID;
		}

	} 
	
	public function setAlbumName($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->album_name !== $v) {
			$this->album_name = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::ALBUM_NAME;
		}

	} 
	
	public function setTrackNo($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->track_no !== $v) {
			$this->track_no = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::TRACK_NO;
		}

	} 
	
	public function setGenre($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->genre !== $v) {
			$this->genre = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::GENRE;
		}

	} 
	
	public function setLyrics($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->lyrics !== $v) {
			$this->lyrics = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::LYRICS;
		}

	} 
	
	public function setBitrate($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->bitrate !== $v) {
			$this->bitrate = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::BITRATE;
		}

	} 
	
	public function setDuration($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->duration !== $v) {
			$this->duration = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::DURATION;
		}

	} 
	
	public function setCreatedDatetime($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [created_datetime] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->created_datetime !== $ts) {
			$this->created_datetime = $ts;
			$this->modifiedColumns[] = RingtoneOriginPeer::CREATED_DATETIME;
		}

	} 
	
	public function setRemark($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->remark !== $v) {
			$this->remark = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::REMARK;
		}

	} 
	
	public function setChecknum($v)
	{

		
		
		if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->checknum !== $v) {
			$this->checknum = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::CHECKNUM;
		}

	} 
	
	public function setConvertSongId($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->convert_song_id !== $v) {
			$this->convert_song_id = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::CONVERT_SONG_ID;
		}

	} 
	
	public function setOriginStatus($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->origin_status !== $v || $v === 0) {
			$this->origin_status = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::ORIGIN_STATUS;
		}

	} 
	
	public function setIsUpload($v)
	{

		
		
		if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->is_upload !== $v || $v === 0) {
			$this->is_upload = $v;
			$this->modifiedColumns[] = RingtoneOriginPeer::IS_UPLOAD;
		}

	} 
	
	public function hydrate(ResultSet $rs, $startcol = 1)
	{
		try {

			$this->id = $rs->getInt($startcol + 0);

			$this->name = $rs->getString($startcol + 1);

			$this->user_id = $rs->getInt($startcol + 2);

			$this->song_id = $rs->getInt($startcol + 3);

			$this->beat_id = $rs->getInt($startcol + 4);

			$this->song_name = $rs->getString($startcol + 5);

			$this->file_path = $rs->getString($startcol + 6);

			$this->clip_id = $rs->getInt($startcol + 7);

			$this->file_path_wav = $rs->getInt($startcol + 8);

			$this->spectrum_path = $rs->getString($startcol + 9);

			$this->spectrum_width = $rs->getInt($startcol + 10);

			$this->category_id = $rs->getInt($startcol + 11);

			$this->artist1_id = $rs->getInt($startcol + 12);

			$this->artist1_name = $rs->getString($startcol + 13);

			$this->artist2_id = $rs->getInt($startcol + 14);

			$this->artist2_name = $rs->getString($startcol + 15);

			$this->artist3_id = $rs->getInt($startcol + 16);

			$this->artist3_name = $rs->getString($startcol + 17);

			$this->composer_id = $rs->getInt($startcol + 18);

			$this->composer_name = $rs->getString($startcol + 19);

			$this->album_id = $rs->getInt($startcol + 20);

			$this->album_name = $rs->getString($startcol + 21);

			$this->track_no = $rs->getInt($startcol + 22);

			$this->genre = $rs->getString($startcol + 23);

			$this->lyrics = $rs->getString($startcol + 24);

			$this->bitrate = $rs->getInt($startcol + 25);

			$this->duration = $rs->getInt($startcol + 26);

			$this->created_datetime = $rs->getTimestamp($startcol + 27, null);

			$this->remark = $rs->getString($startcol + 28);

			$this->checknum = $rs->getString($startcol + 29);

			$this->convert_song_id = $rs->getInt($startcol + 30);

			$this->origin_status = $rs->getInt($startcol + 31);

			$this->is_upload = $rs->getInt($startcol + 32);

			$this->resetModified();

			$this->setNew(false);

						return $startcol + 33; 
		} catch (Exception $e) {
			throw new PropelException("Error populating RingtoneOrigin object", $e);
		}
	}

	
	public function delete($con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("This object has already been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(RingtoneOriginPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			RingtoneOriginPeer::doDelete($this, $con);
			$this->setDeleted(true);
			$con->commit();
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	public function save($con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("You cannot save an object that has been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(RingtoneOriginPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			$affectedRows = $this->doSave($con);
			$con->commit();
			return $affectedRows;
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	protected function doSave($con)
	{
		$affectedRows = 0; 		if (!$this->alreadyInSave) {
			$this->alreadyInSave = true;


						if ($this->isModified()) {
				if ($this->isNew()) {
					$pk = RingtoneOriginPeer::doInsert($this, $con);
					$affectedRows += 1; 										 										 
					$this->setId($pk);  
					$this->setNew(false);
				} else {
					$affectedRows += RingtoneOriginPeer::doUpdate($this, $con);
				}
				$this->resetModified(); 			}

			$this->alreadyInSave = false;
		}
		return $affectedRows;
	} 
	
	protected $validationFailures = array();

	
	public function getValidationFailures()
	{
		return $this->validationFailures;
	}

	
	public function validate($columns = null)
	{
		$res = $this->doValidate($columns);
		if ($res === true) {
			$this->validationFailures = array();
			return true;
		} else {
			$this->validationFailures = $res;
			return false;
		}
	}

	
	protected function doValidate($columns = null)
	{
		if (!$this->alreadyInValidation) {
			$this->alreadyInValidation = true;
			$retval = null;

			$failureMap = array();


			if (($retval = RingtoneOriginPeer::doValidate($this, $columns)) !== true) {
				$failureMap = array_merge($failureMap, $retval);
			}



			$this->alreadyInValidation = false;
		}

		return (!empty($failureMap) ? $failureMap : true);
	}

	
	public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = RingtoneOriginPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->getByPosition($pos);
	}

	
	public function getByPosition($pos)
	{
		switch($pos) {
			case 0:
				return $this->getId();
				break;
			case 1:
				return $this->getName();
				break;
			case 2:
				return $this->getUserId();
				break;
			case 3:
				return $this->getSongId();
				break;
			case 4:
				return $this->getBeatId();
				break;
			case 5:
				return $this->getSongName();
				break;
			case 6:
				return $this->getFilePath();
				break;
			case 7:
				return $this->getClipId();
				break;
			case 8:
				return $this->getFilePathWav();
				break;
			case 9:
				return $this->getSpectrumPath();
				break;
			case 10:
				return $this->getSpectrumWidth();
				break;
			case 11:
				return $this->getCategoryId();
				break;
			case 12:
				return $this->getArtist1Id();
				break;
			case 13:
				return $this->getArtist1Name();
				break;
			case 14:
				return $this->getArtist2Id();
				break;
			case 15:
				return $this->getArtist2Name();
				break;
			case 16:
				return $this->getArtist3Id();
				break;
			case 17:
				return $this->getArtist3Name();
				break;
			case 18:
				return $this->getComposerId();
				break;
			case 19:
				return $this->getComposerName();
				break;
			case 20:
				return $this->getAlbumId();
				break;
			case 21:
				return $this->getAlbumName();
				break;
			case 22:
				return $this->getTrackNo();
				break;
			case 23:
				return $this->getGenre();
				break;
			case 24:
				return $this->getLyrics();
				break;
			case 25:
				return $this->getBitrate();
				break;
			case 26:
				return $this->getDuration();
				break;
			case 27:
				return $this->getCreatedDatetime();
				break;
			case 28:
				return $this->getRemark();
				break;
			case 29:
				return $this->getChecknum();
				break;
			case 30:
				return $this->getConvertSongId();
				break;
			case 31:
				return $this->getOriginStatus();
				break;
			case 32:
				return $this->getIsUpload();
				break;
			default:
				return null;
				break;
		} 	}

	
	public function toArray($keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = RingtoneOriginPeer::getFieldNames($keyType);
		$result = array(
			$keys[0] => $this->getId(),
			$keys[1] => $this->getName(),
			$keys[2] => $this->getUserId(),
			$keys[3] => $this->getSongId(),
			$keys[4] => $this->getBeatId(),
			$keys[5] => $this->getSongName(),
			$keys[6] => $this->getFilePath(),
			$keys[7] => $this->getClipId(),
			$keys[8] => $this->getFilePathWav(),
			$keys[9] => $this->getSpectrumPath(),
			$keys[10] => $this->getSpectrumWidth(),
			$keys[11] => $this->getCategoryId(),
			$keys[12] => $this->getArtist1Id(),
			$keys[13] => $this->getArtist1Name(),
			$keys[14] => $this->getArtist2Id(),
			$keys[15] => $this->getArtist2Name(),
			$keys[16] => $this->getArtist3Id(),
			$keys[17] => $this->getArtist3Name(),
			$keys[18] => $this->getComposerId(),
			$keys[19] => $this->getComposerName(),
			$keys[20] => $this->getAlbumId(),
			$keys[21] => $this->getAlbumName(),
			$keys[22] => $this->getTrackNo(),
			$keys[23] => $this->getGenre(),
			$keys[24] => $this->getLyrics(),
			$keys[25] => $this->getBitrate(),
			$keys[26] => $this->getDuration(),
			$keys[27] => $this->getCreatedDatetime(),
			$keys[28] => $this->getRemark(),
			$keys[29] => $this->getChecknum(),
			$keys[30] => $this->getConvertSongId(),
			$keys[31] => $this->getOriginStatus(),
			$keys[32] => $this->getIsUpload(),
		);
		return $result;
	}

	
	public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = RingtoneOriginPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->setByPosition($pos, $value);
	}

	
	public function setByPosition($pos, $value)
	{
		switch($pos) {
			case 0:
				$this->setId($value);
				break;
			case 1:
				$this->setName($value);
				break;
			case 2:
				$this->setUserId($value);
				break;
			case 3:
				$this->setSongId($value);
				break;
			case 4:
				$this->setBeatId($value);
				break;
			case 5:
				$this->setSongName($value);
				break;
			case 6:
				$this->setFilePath($value);
				break;
			case 7:
				$this->setClipId($value);
				break;
			case 8:
				$this->setFilePathWav($value);
				break;
			case 9:
				$this->setSpectrumPath($value);
				break;
			case 10:
				$this->setSpectrumWidth($value);
				break;
			case 11:
				$this->setCategoryId($value);
				break;
			case 12:
				$this->setArtist1Id($value);
				break;
			case 13:
				$this->setArtist1Name($value);
				break;
			case 14:
				$this->setArtist2Id($value);
				break;
			case 15:
				$this->setArtist2Name($value);
				break;
			case 16:
				$this->setArtist3Id($value);
				break;
			case 17:
				$this->setArtist3Name($value);
				break;
			case 18:
				$this->setComposerId($value);
				break;
			case 19:
				$this->setComposerName($value);
				break;
			case 20:
				$this->setAlbumId($value);
				break;
			case 21:
				$this->setAlbumName($value);
				break;
			case 22:
				$this->setTrackNo($value);
				break;
			case 23:
				$this->setGenre($value);
				break;
			case 24:
				$this->setLyrics($value);
				break;
			case 25:
				$this->setBitrate($value);
				break;
			case 26:
				$this->setDuration($value);
				break;
			case 27:
				$this->setCreatedDatetime($value);
				break;
			case 28:
				$this->setRemark($value);
				break;
			case 29:
				$this->setChecknum($value);
				break;
			case 30:
				$this->setConvertSongId($value);
				break;
			case 31:
				$this->setOriginStatus($value);
				break;
			case 32:
				$this->setIsUpload($value);
				break;
		} 	}

	
	public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = RingtoneOriginPeer::getFieldNames($keyType);

		if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
		if (array_key_exists($keys[1], $arr)) $this->setName($arr[$keys[1]]);
		if (array_key_exists($keys[2], $arr)) $this->setUserId($arr[$keys[2]]);
		if (array_key_exists($keys[3], $arr)) $this->setSongId($arr[$keys[3]]);
		if (array_key_exists($keys[4], $arr)) $this->setBeatId($arr[$keys[4]]);
		if (array_key_exists($keys[5], $arr)) $this->setSongName($arr[$keys[5]]);
		if (array_key_exists($keys[6], $arr)) $this->setFilePath($arr[$keys[6]]);
		if (array_key_exists($keys[7], $arr)) $this->setClipId($arr[$keys[7]]);
		if (array_key_exists($keys[8], $arr)) $this->setFilePathWav($arr[$keys[8]]);
		if (array_key_exists($keys[9], $arr)) $this->setSpectrumPath($arr[$keys[9]]);
		if (array_key_exists($keys[10], $arr)) $this->setSpectrumWidth($arr[$keys[10]]);
		if (array_key_exists($keys[11], $arr)) $this->setCategoryId($arr[$keys[11]]);
		if (array_key_exists($keys[12], $arr)) $this->setArtist1Id($arr[$keys[12]]);
		if (array_key_exists($keys[13], $arr)) $this->setArtist1Name($arr[$keys[13]]);
		if (array_key_exists($keys[14], $arr)) $this->setArtist2Id($arr[$keys[14]]);
		if (array_key_exists($keys[15], $arr)) $this->setArtist2Name($arr[$keys[15]]);
		if (array_key_exists($keys[16], $arr)) $this->setArtist3Id($arr[$keys[16]]);
		if (array_key_exists($keys[17], $arr)) $this->setArtist3Name($arr[$keys[17]]);
		if (array_key_exists($keys[18], $arr)) $this->setComposerId($arr[$keys[18]]);
		if (array_key_exists($keys[19], $arr)) $this->setComposerName($arr[$keys[19]]);
		if (array_key_exists($keys[20], $arr)) $this->setAlbumId($arr[$keys[20]]);
		if (array_key_exists($keys[21], $arr)) $this->setAlbumName($arr[$keys[21]]);
		if (array_key_exists($keys[22], $arr)) $this->setTrackNo($arr[$keys[22]]);
		if (array_key_exists($keys[23], $arr)) $this->setGenre($arr[$keys[23]]);
		if (array_key_exists($keys[24], $arr)) $this->setLyrics($arr[$keys[24]]);
		if (array_key_exists($keys[25], $arr)) $this->setBitrate($arr[$keys[25]]);
		if (array_key_exists($keys[26], $arr)) $this->setDuration($arr[$keys[26]]);
		if (array_key_exists($keys[27], $arr)) $this->setCreatedDatetime($arr[$keys[27]]);
		if (array_key_exists($keys[28], $arr)) $this->setRemark($arr[$keys[28]]);
		if (array_key_exists($keys[29], $arr)) $this->setChecknum($arr[$keys[29]]);
		if (array_key_exists($keys[30], $arr)) $this->setConvertSongId($arr[$keys[30]]);
		if (array_key_exists($keys[31], $arr)) $this->setOriginStatus($arr[$keys[31]]);
		if (array_key_exists($keys[32], $arr)) $this->setIsUpload($arr[$keys[32]]);
	}

	
	public function buildCriteria()
	{
		$criteria = new Criteria(RingtoneOriginPeer::DATABASE_NAME);

		if ($this->isColumnModified(RingtoneOriginPeer::ID)) $criteria->add(RingtoneOriginPeer::ID, $this->id);
		if ($this->isColumnModified(RingtoneOriginPeer::NAME)) $criteria->add(RingtoneOriginPeer::NAME, $this->name);
		if ($this->isColumnModified(RingtoneOriginPeer::USER_ID)) $criteria->add(RingtoneOriginPeer::USER_ID, $this->user_id);
		if ($this->isColumnModified(RingtoneOriginPeer::SONG_ID)) $criteria->add(RingtoneOriginPeer::SONG_ID, $this->song_id);
		if ($this->isColumnModified(RingtoneOriginPeer::BEAT_ID)) $criteria->add(RingtoneOriginPeer::BEAT_ID, $this->beat_id);
		if ($this->isColumnModified(RingtoneOriginPeer::SONG_NAME)) $criteria->add(RingtoneOriginPeer::SONG_NAME, $this->song_name);
		if ($this->isColumnModified(RingtoneOriginPeer::FILE_PATH)) $criteria->add(RingtoneOriginPeer::FILE_PATH, $this->file_path);
		if ($this->isColumnModified(RingtoneOriginPeer::CLIP_ID)) $criteria->add(RingtoneOriginPeer::CLIP_ID, $this->clip_id);
		if ($this->isColumnModified(RingtoneOriginPeer::FILE_PATH_WAV)) $criteria->add(RingtoneOriginPeer::FILE_PATH_WAV, $this->file_path_wav);
		if ($this->isColumnModified(RingtoneOriginPeer::SPECTRUM_PATH)) $criteria->add(RingtoneOriginPeer::SPECTRUM_PATH, $this->spectrum_path);
		if ($this->isColumnModified(RingtoneOriginPeer::SPECTRUM_WIDTH)) $criteria->add(RingtoneOriginPeer::SPECTRUM_WIDTH, $this->spectrum_width);
		if ($this->isColumnModified(RingtoneOriginPeer::CATEGORY_ID)) $criteria->add(RingtoneOriginPeer::CATEGORY_ID, $this->category_id);
		if ($this->isColumnModified(RingtoneOriginPeer::ARTIST1_ID)) $criteria->add(RingtoneOriginPeer::ARTIST1_ID, $this->artist1_id);
		if ($this->isColumnModified(RingtoneOriginPeer::ARTIST1_NAME)) $criteria->add(RingtoneOriginPeer::ARTIST1_NAME, $this->artist1_name);
		if ($this->isColumnModified(RingtoneOriginPeer::ARTIST2_ID)) $criteria->add(RingtoneOriginPeer::ARTIST2_ID, $this->artist2_id);
		if ($this->isColumnModified(RingtoneOriginPeer::ARTIST2_NAME)) $criteria->add(RingtoneOriginPeer::ARTIST2_NAME, $this->artist2_name);
		if ($this->isColumnModified(RingtoneOriginPeer::ARTIST3_ID)) $criteria->add(RingtoneOriginPeer::ARTIST3_ID, $this->artist3_id);
		if ($this->isColumnModified(RingtoneOriginPeer::ARTIST3_NAME)) $criteria->add(RingtoneOriginPeer::ARTIST3_NAME, $this->artist3_name);
		if ($this->isColumnModified(RingtoneOriginPeer::COMPOSER_ID)) $criteria->add(RingtoneOriginPeer::COMPOSER_ID, $this->composer_id);
		if ($this->isColumnModified(RingtoneOriginPeer::COMPOSER_NAME)) $criteria->add(RingtoneOriginPeer::COMPOSER_NAME, $this->composer_name);
		if ($this->isColumnModified(RingtoneOriginPeer::ALBUM_ID)) $criteria->add(RingtoneOriginPeer::ALBUM_ID, $this->album_id);
		if ($this->isColumnModified(RingtoneOriginPeer::ALBUM_NAME)) $criteria->add(RingtoneOriginPeer::ALBUM_NAME, $this->album_name);
		if ($this->isColumnModified(RingtoneOriginPeer::TRACK_NO)) $criteria->add(RingtoneOriginPeer::TRACK_NO, $this->track_no);
		if ($this->isColumnModified(RingtoneOriginPeer::GENRE)) $criteria->add(RingtoneOriginPeer::GENRE, $this->genre);
		if ($this->isColumnModified(RingtoneOriginPeer::LYRICS)) $criteria->add(RingtoneOriginPeer::LYRICS, $this->lyrics);
		if ($this->isColumnModified(RingtoneOriginPeer::BITRATE)) $criteria->add(RingtoneOriginPeer::BITRATE, $this->bitrate);
		if ($this->isColumnModified(RingtoneOriginPeer::DURATION)) $criteria->add(RingtoneOriginPeer::DURATION, $this->duration);
		if ($this->isColumnModified(RingtoneOriginPeer::CREATED_DATETIME)) $criteria->add(RingtoneOriginPeer::CREATED_DATETIME, $this->created_datetime);
		if ($this->isColumnModified(RingtoneOriginPeer::REMARK)) $criteria->add(RingtoneOriginPeer::REMARK, $this->remark);
		if ($this->isColumnModified(RingtoneOriginPeer::CHECKNUM)) $criteria->add(RingtoneOriginPeer::CHECKNUM, $this->checknum);
		if ($this->isColumnModified(RingtoneOriginPeer::CONVERT_SONG_ID)) $criteria->add(RingtoneOriginPeer::CONVERT_SONG_ID, $this->convert_song_id);
		if ($this->isColumnModified(RingtoneOriginPeer::ORIGIN_STATUS)) $criteria->add(RingtoneOriginPeer::ORIGIN_STATUS, $this->origin_status);
		if ($this->isColumnModified(RingtoneOriginPeer::IS_UPLOAD)) $criteria->add(RingtoneOriginPeer::IS_UPLOAD, $this->is_upload);

		return $criteria;
	}

	
	public function buildPkeyCriteria()
	{
		$criteria = new Criteria(RingtoneOriginPeer::DATABASE_NAME);

		$criteria->add(RingtoneOriginPeer::ID, $this->id);

		return $criteria;
	}

	
	public function getPrimaryKey()
	{
		return $this->getId();
	}

	
	public function setPrimaryKey($key)
	{
		$this->setId($key);
	}

	
	public function copyInto($copyObj, $deepCopy = false)
	{

		$copyObj->setName($this->name);

		$copyObj->setUserId($this->user_id);

		$copyObj->setSongId($this->song_id);

		$copyObj->setBeatId($this->beat_id);

		$copyObj->setSongName($this->song_name);

		$copyObj->setFilePath($this->file_path);

		$copyObj->setClipId($this->clip_id);

		$copyObj->setFilePathWav($this->file_path_wav);

		$copyObj->setSpectrumPath($this->spectrum_path);

		$copyObj->setSpectrumWidth($this->spectrum_width);

		$copyObj->setCategoryId($this->category_id);

		$copyObj->setArtist1Id($this->artist1_id);

		$copyObj->setArtist1Name($this->artist1_name);

		$copyObj->setArtist2Id($this->artist2_id);

		$copyObj->setArtist2Name($this->artist2_name);

		$copyObj->setArtist3Id($this->artist3_id);

		$copyObj->setArtist3Name($this->artist3_name);

		$copyObj->setComposerId($this->composer_id);

		$copyObj->setComposerName($this->composer_name);

		$copyObj->setAlbumId($this->album_id);

		$copyObj->setAlbumName($this->album_name);

		$copyObj->setTrackNo($this->track_no);

		$copyObj->setGenre($this->genre);

		$copyObj->setLyrics($this->lyrics);

		$copyObj->setBitrate($this->bitrate);

		$copyObj->setDuration($this->duration);

		$copyObj->setCreatedDatetime($this->created_datetime);

		$copyObj->setRemark($this->remark);

		$copyObj->setChecknum($this->checknum);

		$copyObj->setConvertSongId($this->convert_song_id);

		$copyObj->setOriginStatus($this->origin_status);

		$copyObj->setIsUpload($this->is_upload);


		$copyObj->setNew(true);

		$copyObj->setId(NULL); 
	}

	
	public function copy($deepCopy = false)
	{
				$clazz = get_class($this);
		$copyObj = new $clazz();
		$this->copyInto($copyObj, $deepCopy);
		return $copyObj;
	}

	
	public function getPeer()
	{
		if (self::$peer === null) {
			self::$peer = new RingtoneOriginPeer();
		}
		return self::$peer;
	}

} 